<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            height: 100px;
            background-color: aqua;
            text-align: center;
            /* 单纯对文本居中显示，对其他元素不一定有用 */
            line-height: 100px;
        }
    </style>
</head>
<body>
    <!-- 文本行高会把div撑起来 -->
    <div class="box">我是div元素</div>
</body>
</html>